
/*
//===============================================================================
//  Generated From - SQLite_CSharp_BusinessEntity.vbgen
//
//  The supporting base class SQLiteEntity is in the Architecture directory in "dOOdads".
//  
//  This object is 'abstract' which means you need to inherit from it to be able
//  to instantiate it.  This is very easilly done. You can override properties and
//  methods in your derived class, this allows you to regenerate this class at any
//  time and not worry about overwriting custom code. 
//
//  NEVER EDIT THIS FILE.
//
//  public class YourObject :  _YourObject
//  {
//
//  }
//
//===============================================================================
*/

// Generated by MyGeneration Version # (1.2.0.2)

using System;
using System.Data;
using Finisar.SQLite;
using System.Collections;
using System.Collections.Specialized;

using MyGeneration.dOOdads;

namespace KismetLogger
{
	public abstract class _GPSData : SQLiteEntity
	{
		public _GPSData()
		{
			this.QuerySource = "GPSData";
			this.MappingName = "GPSData";

		}	

		//=================================================================
		//  public Overrides void AddNew()
		//=================================================================
		//
		//=================================================================
		public override void AddNew()
		{
			base.AddNew();
		}
		
		public override void FlushData()
		{
			this._whereClause = null;
			this._aggregateClause = null;
			base.FlushData();
		}
		
		public override string GetAutoKeyColumns()
		{
			return "";
		}
		

		//=================================================================
		//  	public Function LoadAll() As Boolean
		//=================================================================
		//  Loads all of the records in the database, and sets the currentRow to the first row
		//=================================================================
		public bool LoadAll() 
		{
			return this.Query.Load();
		}
	
	
		//=================================================================
		// public Overridable Function LoadByPrimaryKey()  As Boolean
		//=================================================================
		//  Loads a single row of via the primary key
		//=================================================================
		public virtual bool LoadByPrimaryKey(string Bssid)
		{
			this.Where.Bssid.Value = Bssid;
			
			return this.Query.Load();
		}
		
		
		#region Parameters
		protected class Parameters
		{
			
			public static SQLiteParameter Bssid
			{
				get
				{
					return new SQLiteParameter("@Bssid", DbType.String);

				}
			}
			
			public static SQLiteParameter Source
			{
				get
				{
					return new SQLiteParameter("@Source", DbType.String);

				}
			}
			
			public static SQLiteParameter Timesec
			{
				get
				{
					return new SQLiteParameter("@Timesec", DbType.Decimal);

				}
			}
			
			public static SQLiteParameter Timeusec
			{
				get
				{
					return new SQLiteParameter("@Timeusec", DbType.String);

				}
			}
			
			public static SQLiteParameter Lat
			{
				get
				{
					return new SQLiteParameter("@Lat", DbType.Decimal);

				}
			}
			
			public static SQLiteParameter Lon
			{
				get
				{
					return new SQLiteParameter("@Lon", DbType.Decimal);

				}
			}
			
			public static SQLiteParameter Alt
			{
				get
				{
					return new SQLiteParameter("@Alt", DbType.Decimal);

				}
			}
			
			public static SQLiteParameter Speed
			{
				get
				{
					return new SQLiteParameter("@Speed", DbType.Decimal);

				}
			}
			
			public static SQLiteParameter Heading
			{
				get
				{
					return new SQLiteParameter("@Heading", DbType.Decimal);

				}
			}
			
			public static SQLiteParameter Fix
			{
				get
				{
					return new SQLiteParameter("@Fix", DbType.String);

				}
			}
			
			public static SQLiteParameter Signal
			{
				get
				{
					return new SQLiteParameter("@Signal", DbType.Decimal);

				}
			}
			
			public static SQLiteParameter Quality
			{
				get
				{
					return new SQLiteParameter("@Quality", DbType.Decimal);

				}
			}
			
			public static SQLiteParameter Noise
			{
				get
				{
					return new SQLiteParameter("@Noise", DbType.Decimal);

				}
			}
			
		}
		#endregion		
	
		#region ColumnNames
		public class ColumnNames
		{  
            public const string Bssid = "bssid";
            public const string Source = "source";
            public const string Timesec = "timesec";
            public const string Timeusec = "timeusec";
            public const string Lat = "lat";
            public const string Lon = "lon";
            public const string Alt = "alt";
            public const string Speed = "speed";
            public const string Heading = "heading";
            public const string Fix = "fix";
            public const string Signal = "signal";
            public const string Quality = "quality";
            public const string Noise = "noise";

			static public string ToPropertyName(string columnName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[Bssid] = _GPSData.PropertyNames.Bssid;
					ht[Source] = _GPSData.PropertyNames.Source;
					ht[Timesec] = _GPSData.PropertyNames.Timesec;
					ht[Timeusec] = _GPSData.PropertyNames.Timeusec;
					ht[Lat] = _GPSData.PropertyNames.Lat;
					ht[Lon] = _GPSData.PropertyNames.Lon;
					ht[Alt] = _GPSData.PropertyNames.Alt;
					ht[Speed] = _GPSData.PropertyNames.Speed;
					ht[Heading] = _GPSData.PropertyNames.Heading;
					ht[Fix] = _GPSData.PropertyNames.Fix;
					ht[Signal] = _GPSData.PropertyNames.Signal;
					ht[Quality] = _GPSData.PropertyNames.Quality;
					ht[Noise] = _GPSData.PropertyNames.Noise;

				}
				return (string)ht[columnName];
			}

			static private Hashtable ht = null;			 
		}
		#endregion
		
		#region PropertyNames
		public class PropertyNames
		{  
            public const string Bssid = "Bssid";
            public const string Source = "Source";
            public const string Timesec = "Timesec";
            public const string Timeusec = "Timeusec";
            public const string Lat = "Lat";
            public const string Lon = "Lon";
            public const string Alt = "Alt";
            public const string Speed = "Speed";
            public const string Heading = "Heading";
            public const string Fix = "Fix";
            public const string Signal = "Signal";
            public const string Quality = "Quality";
            public const string Noise = "Noise";

			static public string ToColumnName(string propertyName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[Bssid] = _GPSData.ColumnNames.Bssid;
					ht[Source] = _GPSData.ColumnNames.Source;
					ht[Timesec] = _GPSData.ColumnNames.Timesec;
					ht[Timeusec] = _GPSData.ColumnNames.Timeusec;
					ht[Lat] = _GPSData.ColumnNames.Lat;
					ht[Lon] = _GPSData.ColumnNames.Lon;
					ht[Alt] = _GPSData.ColumnNames.Alt;
					ht[Speed] = _GPSData.ColumnNames.Speed;
					ht[Heading] = _GPSData.ColumnNames.Heading;
					ht[Fix] = _GPSData.ColumnNames.Fix;
					ht[Signal] = _GPSData.ColumnNames.Signal;
					ht[Quality] = _GPSData.ColumnNames.Quality;
					ht[Noise] = _GPSData.ColumnNames.Noise;

				}
				return (string)ht[propertyName];
			}

			static private Hashtable ht = null;			 
		}			 
		#endregion	

		#region StringPropertyNames
		public class StringPropertyNames
		{  
            public const string Bssid = "s_Bssid";
            public const string Source = "s_Source";
            public const string Timesec = "s_Timesec";
            public const string Timeusec = "s_Timeusec";
            public const string Lat = "s_Lat";
            public const string Lon = "s_Lon";
            public const string Alt = "s_Alt";
            public const string Speed = "s_Speed";
            public const string Heading = "s_Heading";
            public const string Fix = "s_Fix";
            public const string Signal = "s_Signal";
            public const string Quality = "s_Quality";
            public const string Noise = "s_Noise";

		}
		#endregion		
		
		#region Properties
	
		public virtual string Bssid
	    {
			get
	        {
				return base.Getstring(ColumnNames.Bssid);
			}
			set
	        {
				base.Setstring(ColumnNames.Bssid, value);
			}
		}

		public virtual string Source
	    {
			get
	        {
				return base.Getstring(ColumnNames.Source);
			}
			set
	        {
				base.Setstring(ColumnNames.Source, value);
			}
		}

		public virtual decimal Timesec
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.Timesec);
			}
			set
	        {
				base.Setdecimal(ColumnNames.Timesec, value);
			}
		}

		public virtual string Timeusec
	    {
			get
	        {
				return base.Getstring(ColumnNames.Timeusec);
			}
			set
	        {
				base.Setstring(ColumnNames.Timeusec, value);
			}
		}

		public virtual decimal Lat
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.Lat);
			}
			set
	        {
				base.Setdecimal(ColumnNames.Lat, value);
			}
		}

		public virtual decimal Lon
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.Lon);
			}
			set
	        {
				base.Setdecimal(ColumnNames.Lon, value);
			}
		}

		public virtual decimal Alt
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.Alt);
			}
			set
	        {
				base.Setdecimal(ColumnNames.Alt, value);
			}
		}

		public virtual decimal Speed
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.Speed);
			}
			set
	        {
				base.Setdecimal(ColumnNames.Speed, value);
			}
		}

		public virtual decimal Heading
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.Heading);
			}
			set
	        {
				base.Setdecimal(ColumnNames.Heading, value);
			}
		}

		public virtual string Fix
	    {
			get
	        {
				return base.Getstring(ColumnNames.Fix);
			}
			set
	        {
				base.Setstring(ColumnNames.Fix, value);
			}
		}

		public virtual decimal Signal
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.Signal);
			}
			set
	        {
				base.Setdecimal(ColumnNames.Signal, value);
			}
		}

		public virtual decimal Quality
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.Quality);
			}
			set
	        {
				base.Setdecimal(ColumnNames.Quality, value);
			}
		}

		public virtual decimal Noise
	    {
			get
	        {
				return base.Getdecimal(ColumnNames.Noise);
			}
			set
	        {
				base.Setdecimal(ColumnNames.Noise, value);
			}
		}


		#endregion
		
		#region String Properties
	
		public virtual string s_Bssid
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Bssid) ? string.Empty : base.GetstringAsString(ColumnNames.Bssid);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Bssid);
				else
					this.Bssid = base.SetstringAsString(ColumnNames.Bssid, value);
			}
		}

		public virtual string s_Source
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Source) ? string.Empty : base.GetstringAsString(ColumnNames.Source);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Source);
				else
					this.Source = base.SetstringAsString(ColumnNames.Source, value);
			}
		}

		public virtual string s_Timesec
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Timesec) ? string.Empty : base.GetdecimalAsString(ColumnNames.Timesec);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Timesec);
				else
					this.Timesec = base.SetdecimalAsString(ColumnNames.Timesec, value);
			}
		}

		public virtual string s_Timeusec
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Timeusec) ? string.Empty : base.GetstringAsString(ColumnNames.Timeusec);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Timeusec);
				else
					this.Timeusec = base.SetstringAsString(ColumnNames.Timeusec, value);
			}
		}

		public virtual string s_Lat
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Lat) ? string.Empty : base.GetdecimalAsString(ColumnNames.Lat);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Lat);
				else
					this.Lat = base.SetdecimalAsString(ColumnNames.Lat, value);
			}
		}

		public virtual string s_Lon
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Lon) ? string.Empty : base.GetdecimalAsString(ColumnNames.Lon);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Lon);
				else
					this.Lon = base.SetdecimalAsString(ColumnNames.Lon, value);
			}
		}

		public virtual string s_Alt
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Alt) ? string.Empty : base.GetdecimalAsString(ColumnNames.Alt);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Alt);
				else
					this.Alt = base.SetdecimalAsString(ColumnNames.Alt, value);
			}
		}

		public virtual string s_Speed
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Speed) ? string.Empty : base.GetdecimalAsString(ColumnNames.Speed);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Speed);
				else
					this.Speed = base.SetdecimalAsString(ColumnNames.Speed, value);
			}
		}

		public virtual string s_Heading
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Heading) ? string.Empty : base.GetdecimalAsString(ColumnNames.Heading);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Heading);
				else
					this.Heading = base.SetdecimalAsString(ColumnNames.Heading, value);
			}
		}

		public virtual string s_Fix
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Fix) ? string.Empty : base.GetstringAsString(ColumnNames.Fix);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Fix);
				else
					this.Fix = base.SetstringAsString(ColumnNames.Fix, value);
			}
		}

		public virtual string s_Signal
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Signal) ? string.Empty : base.GetdecimalAsString(ColumnNames.Signal);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Signal);
				else
					this.Signal = base.SetdecimalAsString(ColumnNames.Signal, value);
			}
		}

		public virtual string s_Quality
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Quality) ? string.Empty : base.GetdecimalAsString(ColumnNames.Quality);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Quality);
				else
					this.Quality = base.SetdecimalAsString(ColumnNames.Quality, value);
			}
		}

		public virtual string s_Noise
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Noise) ? string.Empty : base.GetdecimalAsString(ColumnNames.Noise);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Noise);
				else
					this.Noise = base.SetdecimalAsString(ColumnNames.Noise, value);
			}
		}


		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region WhereParameter TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter Bssid
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Bssid, Parameters.Bssid);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Source
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Source, Parameters.Source);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Timesec
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Timesec, Parameters.Timesec);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Timeusec
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Timeusec, Parameters.Timeusec);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Lat
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Lat, Parameters.Lat);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Lon
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Lon, Parameters.Lon);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Alt
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Alt, Parameters.Alt);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Speed
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Speed, Parameters.Speed);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Heading
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Heading, Parameters.Heading);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Fix
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Fix, Parameters.Fix);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Signal
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Signal, Parameters.Signal);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Quality
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Quality, Parameters.Quality);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Noise
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Noise, Parameters.Noise);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter Bssid
		    {
				get
		        {
					if(_Bssid_W == null)
	        	    {
						_Bssid_W = TearOff.Bssid;
					}
					return _Bssid_W;
				}
			}

			public WhereParameter Source
		    {
				get
		        {
					if(_Source_W == null)
	        	    {
						_Source_W = TearOff.Source;
					}
					return _Source_W;
				}
			}

			public WhereParameter Timesec
		    {
				get
		        {
					if(_Timesec_W == null)
	        	    {
						_Timesec_W = TearOff.Timesec;
					}
					return _Timesec_W;
				}
			}

			public WhereParameter Timeusec
		    {
				get
		        {
					if(_Timeusec_W == null)
	        	    {
						_Timeusec_W = TearOff.Timeusec;
					}
					return _Timeusec_W;
				}
			}

			public WhereParameter Lat
		    {
				get
		        {
					if(_Lat_W == null)
	        	    {
						_Lat_W = TearOff.Lat;
					}
					return _Lat_W;
				}
			}

			public WhereParameter Lon
		    {
				get
		        {
					if(_Lon_W == null)
	        	    {
						_Lon_W = TearOff.Lon;
					}
					return _Lon_W;
				}
			}

			public WhereParameter Alt
		    {
				get
		        {
					if(_Alt_W == null)
	        	    {
						_Alt_W = TearOff.Alt;
					}
					return _Alt_W;
				}
			}

			public WhereParameter Speed
		    {
				get
		        {
					if(_Speed_W == null)
	        	    {
						_Speed_W = TearOff.Speed;
					}
					return _Speed_W;
				}
			}

			public WhereParameter Heading
		    {
				get
		        {
					if(_Heading_W == null)
	        	    {
						_Heading_W = TearOff.Heading;
					}
					return _Heading_W;
				}
			}

			public WhereParameter Fix
		    {
				get
		        {
					if(_Fix_W == null)
	        	    {
						_Fix_W = TearOff.Fix;
					}
					return _Fix_W;
				}
			}

			public WhereParameter Signal
		    {
				get
		        {
					if(_Signal_W == null)
	        	    {
						_Signal_W = TearOff.Signal;
					}
					return _Signal_W;
				}
			}

			public WhereParameter Quality
		    {
				get
		        {
					if(_Quality_W == null)
	        	    {
						_Quality_W = TearOff.Quality;
					}
					return _Quality_W;
				}
			}

			public WhereParameter Noise
		    {
				get
		        {
					if(_Noise_W == null)
	        	    {
						_Noise_W = TearOff.Noise;
					}
					return _Noise_W;
				}
			}

			private WhereParameter _Bssid_W = null;
			private WhereParameter _Source_W = null;
			private WhereParameter _Timesec_W = null;
			private WhereParameter _Timeusec_W = null;
			private WhereParameter _Lat_W = null;
			private WhereParameter _Lon_W = null;
			private WhereParameter _Alt_W = null;
			private WhereParameter _Speed_W = null;
			private WhereParameter _Heading_W = null;
			private WhereParameter _Fix_W = null;
			private WhereParameter _Signal_W = null;
			private WhereParameter _Quality_W = null;
			private WhereParameter _Noise_W = null;

			public void WhereClauseReset()
			{
				_Bssid_W = null;
				_Source_W = null;
				_Timesec_W = null;
				_Timeusec_W = null;
				_Lat_W = null;
				_Lon_W = null;
				_Alt_W = null;
				_Speed_W = null;
				_Heading_W = null;
				_Fix_W = null;
				_Signal_W = null;
				_Quality_W = null;
				_Noise_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
		
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region AggregateParameter TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter Bssid
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Bssid, Parameters.Bssid);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Source
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Source, Parameters.Source);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Timesec
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Timesec, Parameters.Timesec);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Timeusec
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Timeusec, Parameters.Timeusec);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Lat
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Lat, Parameters.Lat);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Lon
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Lon, Parameters.Lon);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Alt
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Alt, Parameters.Alt);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Speed
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Speed, Parameters.Speed);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Heading
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Heading, Parameters.Heading);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Fix
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Fix, Parameters.Fix);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Signal
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Signal, Parameters.Signal);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Quality
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Quality, Parameters.Quality);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Noise
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Noise, Parameters.Noise);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter Bssid
		    {
				get
		        {
					if(_Bssid_W == null)
	        	    {
						_Bssid_W = TearOff.Bssid;
					}
					return _Bssid_W;
				}
			}

			public AggregateParameter Source
		    {
				get
		        {
					if(_Source_W == null)
	        	    {
						_Source_W = TearOff.Source;
					}
					return _Source_W;
				}
			}

			public AggregateParameter Timesec
		    {
				get
		        {
					if(_Timesec_W == null)
	        	    {
						_Timesec_W = TearOff.Timesec;
					}
					return _Timesec_W;
				}
			}

			public AggregateParameter Timeusec
		    {
				get
		        {
					if(_Timeusec_W == null)
	        	    {
						_Timeusec_W = TearOff.Timeusec;
					}
					return _Timeusec_W;
				}
			}

			public AggregateParameter Lat
		    {
				get
		        {
					if(_Lat_W == null)
	        	    {
						_Lat_W = TearOff.Lat;
					}
					return _Lat_W;
				}
			}

			public AggregateParameter Lon
		    {
				get
		        {
					if(_Lon_W == null)
	        	    {
						_Lon_W = TearOff.Lon;
					}
					return _Lon_W;
				}
			}

			public AggregateParameter Alt
		    {
				get
		        {
					if(_Alt_W == null)
	        	    {
						_Alt_W = TearOff.Alt;
					}
					return _Alt_W;
				}
			}

			public AggregateParameter Speed
		    {
				get
		        {
					if(_Speed_W == null)
	        	    {
						_Speed_W = TearOff.Speed;
					}
					return _Speed_W;
				}
			}

			public AggregateParameter Heading
		    {
				get
		        {
					if(_Heading_W == null)
	        	    {
						_Heading_W = TearOff.Heading;
					}
					return _Heading_W;
				}
			}

			public AggregateParameter Fix
		    {
				get
		        {
					if(_Fix_W == null)
	        	    {
						_Fix_W = TearOff.Fix;
					}
					return _Fix_W;
				}
			}

			public AggregateParameter Signal
		    {
				get
		        {
					if(_Signal_W == null)
	        	    {
						_Signal_W = TearOff.Signal;
					}
					return _Signal_W;
				}
			}

			public AggregateParameter Quality
		    {
				get
		        {
					if(_Quality_W == null)
	        	    {
						_Quality_W = TearOff.Quality;
					}
					return _Quality_W;
				}
			}

			public AggregateParameter Noise
		    {
				get
		        {
					if(_Noise_W == null)
	        	    {
						_Noise_W = TearOff.Noise;
					}
					return _Noise_W;
				}
			}

			private AggregateParameter _Bssid_W = null;
			private AggregateParameter _Source_W = null;
			private AggregateParameter _Timesec_W = null;
			private AggregateParameter _Timeusec_W = null;
			private AggregateParameter _Lat_W = null;
			private AggregateParameter _Lon_W = null;
			private AggregateParameter _Alt_W = null;
			private AggregateParameter _Speed_W = null;
			private AggregateParameter _Heading_W = null;
			private AggregateParameter _Fix_W = null;
			private AggregateParameter _Signal_W = null;
			private AggregateParameter _Quality_W = null;
			private AggregateParameter _Noise_W = null;

			public void AggregateClauseReset()
			{
				_Bssid_W = null;
				_Source_W = null;
				_Timesec_W = null;
				_Timeusec_W = null;
				_Lat_W = null;
				_Lon_W = null;
				_Alt_W = null;
				_Speed_W = null;
				_Heading_W = null;
				_Fix_W = null;
				_Signal_W = null;
				_Quality_W = null;
				_Noise_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	
			
		
		protected override IDbCommand GetInsertCommand()
		{
			SQLiteCommand cmd = new SQLiteCommand();
			cmd.CommandType = CommandType.Text;
			cmd.CommandText =
			@"INSERT INTO [GPSData]
			(
				[bssid],
				[source],
				[timesec],
				[timeusec],
				[lat],
				[lon],
				[alt],
				[speed],
				[heading],
				[fix],
				[signal],
				[quality],
				[noise]
			)
			VALUES
			(
				@bssid,
				@source,
				@timesec,
				@timeusec,
				@lat,
				@lon,
				@alt,
				@speed,
				@heading,
				@fix,
				@signal,
				@quality,
				@noise
			)";

			CreateParameters(cmd);
			return cmd;
		}
	
		protected override IDbCommand GetUpdateCommand()
		{
			SQLiteCommand cmd = new SQLiteCommand();
			cmd.CommandType = CommandType.Text;
			cmd.CommandText = 
			@"UPDATE [GPSData] SET 
				[source]=@source,
				[timesec]=@timesec,
				[timeusec]=@timeusec,
				[lat]=@lat,
				[lon]=@lon,
				[alt]=@alt,
				[speed]=@speed,
				[heading]=@heading,
				[fix]=@fix,
				[signal]=@signal,
				[quality]=@quality,
				[noise]=@noise
			WHERE
				[bssid]=@bssid";

			CreateParameters(cmd);
			return cmd;
		}
	
		protected override IDbCommand GetDeleteCommand()
		{
			SQLiteCommand cmd = new SQLiteCommand();
			cmd.CommandType = CommandType.Text;
			cmd.CommandText =
			@"DELETE FROM [GPSData] 
			WHERE
				[bssid]=@bssid";

	
			SQLiteParameter p;
			p = cmd.Parameters.Add(Parameters.Bssid);
			p.SourceColumn = ColumnNames.Bssid;
			p.SourceVersion = DataRowVersion.Current;

  
			return cmd;
		}
		
		private IDbCommand CreateParameters(SQLiteCommand cmd)
		{
			SQLiteParameter p;
		
			p = cmd.Parameters.Add(Parameters.Bssid);
			p.SourceColumn = ColumnNames.Bssid;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Source);
			p.SourceColumn = ColumnNames.Source;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Timesec);
			p.SourceColumn = ColumnNames.Timesec;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Timeusec);
			p.SourceColumn = ColumnNames.Timeusec;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Lat);
			p.SourceColumn = ColumnNames.Lat;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Lon);
			p.SourceColumn = ColumnNames.Lon;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Alt);
			p.SourceColumn = ColumnNames.Alt;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Speed);
			p.SourceColumn = ColumnNames.Speed;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Heading);
			p.SourceColumn = ColumnNames.Heading;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Fix);
			p.SourceColumn = ColumnNames.Fix;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Signal);
			p.SourceColumn = ColumnNames.Signal;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Quality);
			p.SourceColumn = ColumnNames.Quality;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Noise);
			p.SourceColumn = ColumnNames.Noise;
			p.SourceVersion = DataRowVersion.Current;


			return cmd;
		}		
		
	
	}
}
